home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
PrintManager.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-01
|
3KB
|
128 lines
#ifndef PrintManager_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define PrintManager_First
#include "Dialog.h"
class PrintDialog;
class PrintPort;
class Printer;
class OrdCollection;
class Printer;
//---- PrinterSettings ------------------------------------------------------------
class PrinterSettings : public Object {
public:
Point paperSize, topLeftMargin, bottomRightMargin;
char *name;
bool showgrid;
public:
MetaDef(PrinterSettings);
PrinterSettings(Point ps, Point tlm, Point brm, Rectangle pr);
~PrinterSettings();
char *GetName()
{ return name; }
void SetPaperSize(Point);
Point GetPaperSize()
{ return paperSize; }
void SetTopLeftMargin(Point tlm);
Point GetTopLeftMargin()
{ return topLeftMargin; }
void SetBottomRightMargin(Point brm);
Point GetBottomRightMargin()
{ return bottomRightMargin; }
Rectangle GetPrintRect();
Rectangle GetViewRect();
void ShowPageBreaks(bool mode);
bool GetShowPageBreaks()
{ return showgrid; }
Printer *GetPrinter();
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
};
//---- PrintManager ------------------------------------------------------------
class PrintManager : public Object {
public:
OrdCollection *printers;
PrinterSettings *currSettings;
Printer *currPrinter;
VObject *vobject;
public:
MetaDef(PrintManager);
PrintManager();
~PrintManager();
void InstallPrinter(char *name);
Printer *PrinterAt(int no);
int PrinterId(Printer*);
void SetPaperSize(Point ps)
{ currSettings->SetPaperSize(ps); }
Point GetPaperSize()
{ return currSettings->GetPaperSize(); }
void SetTopLeftMargin(Point tlm)
{ currSettings->SetTopLeftMargin(tlm); }
Point GetTopLeftMargin()
{ return currSettings->GetTopLeftMargin(); }
void SetBottomRightMargin(Point brm)
{ currSettings->SetBottomRightMargin(brm); }
Point GetBottomRightMargin()
{ return currSettings->GetBottomRightMargin(); }
Rectangle GetPrintRect()
{ return currSettings->GetPrintRect(); }
Printer *GetPrinter()
{ return currPrinter; }
Rectangle GetViewRect()
{ return currSettings->GetViewRect(); }
void ShowPageBreaks(bool mode);
bool GetShowPageBreaks(VObject *vop);
Printer *FindPrinter(char *name);
virtual PrintDialog *MakePrintDialog();
void Print(char*, int from, int to);
void ShowPageGrid(Rectangle r, VObject *);
void ShowPrintDialog(VObject *v);
virtual void PrintPage(int np, PrintPort *printport, Rectangle pgr);
};
//---- SmartPrintManager -------------------------------------------------------
class SmartPrintManager {
class PrintManager *pm;
public:
SmartPrintManager()
{ }
~SmartPrintManager()
{ SafeDelete(pm); }
PrintManager *MakePrintManager();
operator PrintManager* ()
{ return MakePrintManager(); }
PrintManager* operator-> ()
{ return MakePrintManager(); }
};
extern SmartPrintManager gPrintManager;
extern bool gPrinting;
#endif